//
//
//
//
//
//
//
//
//
//
import abstractButton from '../internal/abstractButton'
import icon from '../icon'
import {isNotNull} from '../utils'
export default {
name: 'mu-tab',
props: {
icon: {
type: String,
default: ''
},
title: {
type: String,
default: ''
},
href: {
type: String
},
disabled: {
type: Boolean
},
value: {}
},
computed: {
active () {
return isNotNull(this.value) && this.$parent.value === this.value
}
},
methods: {
tabClick (e) {
if (this.$parent.handleTabClick) this.$parent.handleTabClick(this.value, this)
this.$emit('click', e)
}
},
watch: {
active (val, oldVal) {
if (val === oldVal) return
if (val) this.$emit('active')
}
},
components: {
'abstract-button': abstractButton,
icon
}
}
|